// Netris. A free, open source Tetris(tm) clone
// Copyright (C) 2005  Parez Timothy
// 
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

using System;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
using SdlDotNet;
using SdlDotNet.Sprites;

namespace Beaglebits.Games.Netris
{
	public class Square : Sprite
    {
        private static Random rnd = new Random();

		public Square(Surface SquareSurface) : base(SquareSurface)
		{
            //Constructor
		}
	
		/// <summary>
		/// Blit this square on the parent surface
		/// </summary>
		/// <param name="Parent">The surface on which this sprite should be blitted</param>
		public void Show(Surface Parent)
        {
        
        	Parent.Blit(this.Surface,new Point(this.X,this.Y));          
        }

		/// <summary>
		/// Hide this square from the parent surface
		/// </summary>
		/// <param name="Parent">The surface from which this sprite should be hidden</param>
        public void Hide(Surface Parent)
        {
        	Parent.Fill(this.Rectangle,GameField.BackgroundColor);
        }
        
        public override void Kill()
        {
        	this.Hide(this.Surface);
        }
    }
}
